package main

import (
	"fmt"
	"sync"
)

func main() {
	pool:=&sync.Pool{
		New: func() interface{} {
			fmt.Println("new pool item created")
			return 100
		},
	}

	pool.Put(5)
	pool.Put(50)
	pool.Put(500)
	pool.Put(5000)
	pool.Put(50000)


	fmt.Println(pool.Get())
	fmt.Println(pool.Get())
	fmt.Println(pool.Get())
	fmt.Println(pool.Get())
	fmt.Println(pool.Get())
	fmt.Println(pool.Get())
}
